package lab02.test30;

import java.util.Scanner;

/**
 * Created by dell on 2017/11/15.
 */
public class Test {
    public static void main(String[] args) {
        int i;
        float[] score;float sum=0;
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入要计算平均成绩的人数：");
        int a=scanner.nextInt();
        score = new float[a];
        for (i=0;i<a;i++) {
            System.out.println("请输入第" + (i + 1) + "个人的成绩：");
            score[i] = scanner.nextFloat();
            sum=sum+score[i];
        }
        System.out.println("平均成绩为："+sum/a);
    }
}

